<extend name="Public/base" />
<block name="body">
<style>
      	.wrapper-border {
		vertical-align: top;
		letter-spacing: normal;
		word-spacing: normal;
		padding: 14px;
		position: relative;
		z-index: 1;
                list-style: none;
                float: left;
	}
    .text{
		background-color: #FFF;
		text-align: center;
		border: solid 1px #F5F5F5;
	}
	.text:hover{
		border-color: #27A9E3;
	}
	.text i{
		padding: 20px;
                line-height: 40px;
                font-size: 14px;
	}
	
	.text a.del {
		font-family: Tahoma;
		font-size: 10px;
		line-height: 14px;
		color: #CCC;
		background-color: #FFF;
		vertical-align: middle;
		text-align: center;
		display: none;
		width: 14px;
		height: 14px;
		border: solid 1px;
		border-radius: 8px;
		position: absolute;
		z-index: 2;
		top: 8px;
		right: 8px;
                text-decoration: none;
	}

	.text:hover a.del {
		color: #27A9E3;
		border-color: #27A9E3;
		display: block;
	}
	.text:hover a.del:hover {
		text-decoration: none;
	}
</style>
<!-- page content -->
<div class="right_col" role="main">
    <div class="">
        <div class="clearfix"></div>
        <div class="row">
            <ul class="tab-nav ">
                <li data-tab="tab1" class=""><a href="{:U('index')}">课程列表</a></li>

                <li data-tab="tab2" class="current"><a href="javascript:void(0);">{$meta_title}</a></li>

            </ul>

            <div class="col-md-12 col-xs-12">
                <div class="x_panel">

                    <div class="x_content">
                      <form action="{:U('')}" class="form1 form-horizontal row-border" >

                          <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">课程名称<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                              <input type="text" name="title" id="first-name" required="required" class="form-control col-md-7 col-xs-12">
                            </div>
                          </div>
                          <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">封面图 <span class="required">*</span>
                            </label>
                            <div class="col-md-9 col-sm-9 col-xs-12">
                                       
                                       <div class="upload_file-button" onclick="$('.select_image_upload').click();return false;"><!--点击上传图片-->
                                       </div>
                                       <div class="upload-img-box" onclick="$('.select_image_upload').click();return false;"><!--存放图片-->   
                                        <input type="hidden"  name="pic" value="">
                                           
                                       </div>
                                       <input type="file" name="image" class="input-file select_image_upload" style="display: none;">

                                    </div>
                          </div>
                          <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">上传视频</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                               <button  type="button" class="btn " onclick="$('.select_image_upload2').click();
                                                      return false;">课程视频</button>
                            <input type="file" name="image" class="input-file select_image_upload2" style="display: none;">
                            <div id="input_text"><input type="hidden"  name="vediopath" value=""></div>
                            </div>
                          </div>
                          
                         <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">类型<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                              <input type="radio"  name="pay_type" checked value="1" class="form-control">金币<input type="radio"  name="pay_type"  value="2"  class="form-control">银币
                            </div>
                          </div>
                             <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">需要数量<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                              <input type="text" name="pay_num"  id="first-name" required="required" class="form-control col-md-7 col-xs-12">
                            </div>
                          </div>
                          <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">详情</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                              {:hook('adminUEditor', array('name'=>'content','value'=>""))}
                            </div>
                          </div>
                          <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">观看人数</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                              <input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="view_num" value="">
                            </div>
                          </div>
                          <div class="form-group">
                            <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">试看人数</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                              <input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="try_num" value="">
                            </div>
                          </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="submit" class="btn btn-info">新增课程</button>
                                </div>
                            </div>
                          

                        </form>

                      </div>
                          
                          
                      </div>
                        

                    </div>
                   
                    </div>
                   
                  </div>
                </div>
   

    
</block>
<block name="script">
 <script type="text/javascript" src="__STATIC__/jquery-upload/js/jquery.iframe-transport.js" charset="utf-8"></script> 
       <script type="text/javascript" src="__STATIC__/jquery-upload/js/vendor/jquery.ui.widget.js" charset="utf-8"></script> 
    <script type="text/javascript" src="__STATIC__/jquery-upload/js/jquery.fileupload.min.js" charset="utf-8"></script>
  
    
    <script>
    $(".select_image_upload").fileupload({
        dataType: 'json',
        url: '{:U('File/uploadPicture')}',
        formData: {},
        add: function (e, data) {
            data.submit();
        },
        done: function (e, data) {
            var param = data.result;
            if (param.code == 1) {
                
                $(this).parent().find(".upload-img-box").html('<input type="hidden" name="pic" value="'+param.data.path+'"  /><img src="'+param.data.path+'"  id="img_box1" class="hei"> <em class="edit_img_icon">&nbsp;</em>');
             
         } else {
                ui.error(param.msg);
            }

        }
    });
    $(".select_image_upload2").fileupload({
        dataType: 'json',
        url: '{:U('File/uploadVideo')}',
        formData: {},
        add: function (e, data) {
            data.submit();
        },
        done: function (e, data) {
            var param = data.result;
            if (param.code == 1) {
                
                $("#input_text").html('<input type="hidden" name="vediopath" value="'+param.data.path+'"  /><a href="">'+param.data.path+'</a> <em class="edit_img_icon">&nbsp;</em>');
             
         } else {
                ui.error(param.msg);
            }

        }
    });
    Lzy.highlight_subnav('{:U('index')}');  
    </script>
</block>